package mjc.egg;
import mjc.compiler.*;
import mjc.gc.*;
import mg.egg.eggc.compiler.libjava.lex.*;
import mg.egg.eggc.compiler.libjava.messages.*;
import mg.egg.eggc.compiler.libjava.*;
import mg.egg.eggc.compiler.libjava.problem.IProblem;
import java.util.Vector;
public class S_DEF_MJAVA {
LEX_MJAVA scanner;
  S_DEF_MJAVA() {
    }
  S_DEF_MJAVA(LEX_MJAVA scanner) {
    this.scanner = scanner;
    this.att_scanner = scanner;
    }
int [] sync= new int[0];
  Liste<INFOMethode, String> att_methodes;
  Liste<INFOVar, String> att_attributs;
  String att_droit;
  TDS att_tds;
  LEX_MJAVA att_scanner;
  private void regle10() throws Exception {

    //declaration
    S_TYPE_MJAVA x_2 = new S_TYPE_MJAVA(scanner) ;
    T_MJAVA x_3 = new T_MJAVA(scanner ) ;
    T_MJAVA x_5 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser() ;
    x_3.analyser(LEX_MJAVA.token_ident);
      action_attr_10(x_2, x_3);
    x_5.analyser(LEX_MJAVA.token_pv);
  }
  private void regle11() throws Exception {

    //declaration
    S_TYPE_MJAVA x_2 = new S_TYPE_MJAVA(scanner) ;
    T_MJAVA x_3 = new T_MJAVA(scanner ) ;
    T_MJAVA x_4 = new T_MJAVA(scanner ) ;
    S_PARFS_MJAVA x_6 = new S_PARFS_MJAVA(scanner) ;
    T_MJAVA x_7 = new T_MJAVA(scanner ) ;
    S_BLOC_MJAVA x_9 = new S_BLOC_MJAVA(scanner) ;
    //appel
    x_2.analyser() ;
    x_3.analyser(LEX_MJAVA.token_ident);
    x_4.analyser(LEX_MJAVA.token_paro);
      action_trans_11(x_2, x_3, x_6, x_9);
    x_6.analyser() ;
    x_7.analyser(LEX_MJAVA.token_parf);
      action_methode_11(x_2, x_3, x_6, x_9);
    x_9.analyser() ;
  }
  private void regle12() throws Exception {

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    T_MJAVA x_3 = new T_MJAVA(scanner ) ;
    S_PARFS_MJAVA x_5 = new S_PARFS_MJAVA(scanner) ;
    T_MJAVA x_6 = new T_MJAVA(scanner ) ;
    S_BLOC_MJAVA x_8 = new S_BLOC_MJAVA(scanner) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_ident);
    x_3.analyser(LEX_MJAVA.token_paro);
      action_trans_12(x_2, x_5, x_8);
    x_5.analyser() ;
    x_6.analyser(LEX_MJAVA.token_parf);
      action_constr_12(x_2, x_5, x_8);
    x_8.analyser() ;
  }
private void action_trans_11(S_TYPE_MJAVA x_2, T_MJAVA x_3, S_PARFS_MJAVA x_6, S_BLOC_MJAVA x_9) throws Exception {
try {
// instructions
x_6.att_tds=this.att_tds;
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_methode_11(S_TYPE_MJAVA x_2, T_MJAVA x_3, S_PARFS_MJAVA x_6, S_BLOC_MJAVA x_9) throws Exception {
try {
// locales
INFOMethode loc_i;
// instructions
x_9.att_tds=this.att_tds;
loc_i=this.att_methodes.isPresent(x_3.att_txt);
if ((loc_i!=null)){
if ((loc_i.comparerParam(x_6.att_param))){
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMJAVAMessages.id_METHODE, MJAVAMessages.METHODE,new Object[]{""+x_3.att_txt});

}
else {
loc_i= new INFOMethode(x_3.att_txt, x_6.att_param, x_2.att_type);
    this.att_methodes.ajouter(loc_i, this.att_droit);
}
}
else {
loc_i= new INFOMethode(x_3.att_txt, x_6.att_param, x_2.att_type);
    this.att_methodes.ajouter(loc_i, this.att_droit);
}
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_attr_10(S_TYPE_MJAVA x_2, T_MJAVA x_3) throws Exception {
try {
// locales
INFOVar loc_i;
// instructions
loc_i=this.att_attributs.isPresent(x_3.att_txt);
if ((loc_i==null)){
loc_i= new INFOVar(x_3.att_txt, x_2.att_type);
    this.att_attributs.ajouter(loc_i, this.att_droit);
}
else {
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMJAVAMessages.id_ATTRIBUT, MJAVAMessages.ATTRIBUT,new Object[]{""+x_3.att_txt});

}
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_constr_12(T_MJAVA x_2, S_PARFS_MJAVA x_5, S_BLOC_MJAVA x_8) throws Exception {
try {
// locales
INFOMethode loc_i;
// instructions
x_8.att_tds=this.att_tds;
loc_i=this.att_methodes.isPresent(x_2.att_txt);
if ((loc_i!=null)){
if ((loc_i.comparerParam(x_5.att_param))){
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMJAVAMessages.id_METHODE, MJAVAMessages.METHODE,new Object[]{""+x_2.att_txt});

}
else {
loc_i= new INFOMethode(x_2.att_txt, x_5.att_param);
    this.att_methodes.ajouter(loc_i, this.att_droit);
}
}
else {
loc_i= new INFOMethode(x_2.att_txt, x_5.att_param);
    this.att_methodes.put(loc_i, this.att_droit);
}
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_trans_12(T_MJAVA x_2, S_PARFS_MJAVA x_5, S_BLOC_MJAVA x_8) throws Exception {
try {
// instructions
x_5.att_tds=this.att_tds;
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
  public void analyser () throws Exception {
    scanner.lit ( 1 ) ;
    switch ( scanner.fenetre[0].code ) {
      case LEX_MJAVA.token_int : // 66284
        scanner.lit ( 2 ) ;
        switch ( scanner.fenetre[1].code ) {
          case LEX_MJAVA.token_ident : // 66312
            scanner.lit ( 3 ) ;
            switch ( scanner.fenetre[2].code ) {
              case LEX_MJAVA.token_pv : // 66277
                regle10 () ;
              break ;
              case LEX_MJAVA.token_paro : // 66270
                regle11 () ;
              break ;
              default :
                       scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[2].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_ident);
            }
          break ;
          default :
                   scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[1].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_int);
        }
      break ;
      case LEX_MJAVA.token_bool : // 66285
        scanner.lit ( 2 ) ;
        switch ( scanner.fenetre[1].code ) {
          case LEX_MJAVA.token_ident : // 66312
            scanner.lit ( 3 ) ;
            switch ( scanner.fenetre[2].code ) {
              case LEX_MJAVA.token_pv : // 66277
                regle10 () ;
              break ;
              case LEX_MJAVA.token_paro : // 66270
                regle11 () ;
              break ;
              default :
                       scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[2].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_ident);
            }
          break ;
          default :
                   scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[1].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_bool);
        }
      break ;
      case LEX_MJAVA.token_void : // 66283
        scanner.lit ( 2 ) ;
        switch ( scanner.fenetre[1].code ) {
          case LEX_MJAVA.token_ident : // 66312
            scanner.lit ( 3 ) ;
            switch ( scanner.fenetre[2].code ) {
              case LEX_MJAVA.token_pv : // 66277
                regle10 () ;
              break ;
              case LEX_MJAVA.token_paro : // 66270
                regle11 () ;
              break ;
              default :
                       scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[2].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_ident);
            }
          break ;
          default :
                   scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[1].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_void);
        }
      break ;
      case LEX_MJAVA.token_ident : // 66312
        scanner.lit ( 2 ) ;
        switch ( scanner.fenetre[1].code ) {
          case LEX_MJAVA.token_ident : // 66312
            scanner.lit ( 3 ) ;
            switch ( scanner.fenetre[2].code ) {
              case LEX_MJAVA.token_pv : // 66277
                regle10 () ;
              break ;
              case LEX_MJAVA.token_paro : // 66270
                regle11 () ;
              break ;
              default :
                       scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[2].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_ident);
            }
          break ;
          case LEX_MJAVA.token_paro : // 66270
            regle12 () ;
          break ;
          default :
                   scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[1].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_ident);
        }
      break ;
      default :
               scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[0].getNom()});
    }
  }
  }
